<template>
    <!--页面侧边 -->
    <div>
        <el-row>
            <el-col :span="3">
                <el-menu style="width: 250px; min-height: calc(100vh - 70px)"
                    default-active="0" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
                    background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
                    <el-menu-item index="0" @click="home">
                        <i class="el-icon-s-home"></i>
                        <span slot="title">主页</span>
                    </el-menu-item>
                    <el-menu-item index="1" @click="fill">
                        <i class="el-icon-s-order"></i>
                        <span slot="title">我要填报</span>
                    </el-menu-item>
                    <el-menu-item index="2" @click="property">
                        <i class="el-icon-coin"></i>
                        <span slot="title">资产</span>
                    </el-menu-item>
                    <el-menu-item index="3" @click="product">
                        <i class="el-icon-tickets"></i>
                        <span slot="title">产品情况</span>
                    </el-menu-item>
                    <el-menu-item index="4" @click="materials">
                        <i class="el-icon-document"></i>
                        <span slot="title">原材料情况</span>
                    </el-menu-item>
                    <el-menu-item index="5" @click="energy">
                        <i class="el-icon-odometer"></i>
                        <span slot="title">能源供应情况</span>
                    </el-menu-item>
                    <el-menu-item index="6" @click="talents">
                        <i class="el-icon-pie-chart"></i>
                        <span slot="title">人才需求情况</span>
                    </el-menu-item>
                    <el-menu-item index="7" @click="logistics">
                        <i class="el-icon-truck"></i>
                        <span slot="title">物流情况</span>
                    </el-menu-item>
                    <el-menu-item index="8" @click="appeal">
                        <i class="el-icon-question"></i>
                        <span slot="title">诉求上报</span>
                    </el-menu-item>
                    <el-menu-item index="9" @click="feedback">
                        <i class="el-icon-info"></i>
                        <span slot="title">诉求反馈</span>
                    </el-menu-item>
                    <el-menu-item index="9" @click="service">
                        <i class="el-icon-s-claim"></i>
                        <span slot="title">相关服务</span>
                    </el-menu-item>
                </el-menu>
            </el-col>
        </el-row>
    </div>
</template>
<script>
export default {
    name: 'Sider',
    data() {
        return {
            roleId: localStorage.getItem('roleId')

        }
    },
    methods:{
        //首页
        home(){
            this.$router.push('/home')
        },
        //填报页面
        fill(){

        },
        //资产页面
        property(){

        },
        //产品情况页面
        product(){

        },
        //原材料情况页面
        materials(){

        },
        //能源供应情况页面
        energy(){

        },
        //人才需求情况页面
        talents(){
          if (this.roleId === '1'){
            this.$router.push('/talent')
          }else if (this.roleId === '2'){
            this.$router.push('/approvalAdd')
          }else {
            alert('您无法查看')
          }
        },
        //物流情况页面
        logistics(){
          if (this.roleId === '1'){
            this.$router.push('/logistics')
          }else if (this.roleId === '2'){
            this.$router.push('/approvalLog')
          }else {
            alert('您无法查看')
          }
        },
        //诉求上报页面
        appeal(){
            alert(this.roleId)
            if(this.roleId === '1'){
                this.$router.push('/appealreportingUser')
            }else if(this.roleId === '2'){
                // alert(this.userId)
                this.$router.push('/appealreportingAdmin')
            }else{
               alert('您没有该权限')
            }
        },
        //诉求反馈w页面
        feedback(){
            if(this.roleId === '3'){
                this.$router.push('/appealreportingSuperAdmin')
            }else if(this.roleId === '1'){
                this.$router.push('/completeUser')
            }else{
                alert('您没有该权限')
            }
        },
        //相关服务
        service(){

        },
        handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
}
</script>